<template>
  <div class="width hello">
    <div class="nav">
      <a href="#/"><i class="fa fa-angle-left"></i></a>
      登录
    </div>
    <div class="login-con">
        <form action="" name="loginForm" @submit.prevent="dengForm">
            <!--<x-input class="input" v-model="datas.name" name="name" placeholder="请输入姓名" is-type="china-name"></x-input><br>-->
            <input type="text" class="input" v-model="datas.name" name="name" placeholder="手机号/用户名">
            <x-input class="input" v-model="datas.password" type="password" name="password" placeholder="请输入密码" :min="6" :max="18"></x-input><br>
          <button type="submit">登录</button>
        </form>
        <a href="#/deng">管理登录</a>
        <a href="#/zhuce">注册</a>
    </div>
  </div>
</template>
<script>
  import axios from 'axios'
  import { XInput, Group, XButton, Cell } from 'vux'
  import { mapState } from 'vuex'
  export default{
    components: {
    XInput,
    XButton,
    Group,
    Cell
  },
    data:function(){
      return {
        datas:{},
        user:''
      }
    },
    mounted:function(){

    },
    methods:{
      
      dengForm:function(){
        var that = this;
        axios.post('los/login',this.datas).then(function(result){
          if(result.data.error == 0){
            location.href="#/"
          }else{
            alert(user.message);
          }
        }).catch(function(err){
          console.log(err);
        })
        
      }
    }
  }
</script>
<style scoped>
  .login-con > a{
    line-height: 20px;
    padding: 0 10px;
    border-radius: 2px;
    margin-top: 20px;
    margin-bottom: 8px;
    /*border: 1px solid #aaa;*/
  }
  button{
    border:none;
    width: 100%;
    line-height: 40px;
    border-radius: 10px;
    /*margin-top: 20px;*/
    margin-bottom: 8px;
    color: #fff;
    background: #1E90FF;
  }
  .login-con{
    padding: 10px 30px;
    text-align: right;
  }
  input{
    width: 100%;
    padding: 15px;
  }
  .input{
   border: none;
   box-shadow: 0 0 1px 1px #1E90FF;
   border-radius: 25px;
   margin-top: 10px;
  }
  .nav{
    border-bottom: 1px solid #ccc;
    line-height: 40px;
    overflow: hidden;
    text-align: center;
    padding: 0 15px;
    font-size: 16px;
    background: #1E90FF;
    color: #fff;
  }
  .nav i{
    float: left;
    font-size: 28px;
    margin-top: 5px;
    color: #fff;
  }

  
</style>